package com.newasia.management.dto.HomepageBanner;

import com.newasia.commons.result.AbstractRequest;
import com.newasia.commons.tool.exception.ValidateException;
import com.newasia.management.constants.ManagementRetCode;
import lombok.Data;

import java.util.Date;

/**
 * 腾讯课堂搜索【咕泡学院】
 * 官网：www.gupaoedu.com
 * 风骚的Mic 老师
 * create-date: 2019/7/31-19:21
 */
@Data
public class CreateBannerRequest extends AbstractRequest {


    private Integer type;

    private Long skuId;

    private Integer sortOrder;

    private String fullUrl;

    private String picUrl;


    private Date created;

    private Date updated;

    @Override
    public void requestCheck() {
        if(type==null||(type==0&&skuId==null)||(type==1&&fullUrl==null)||picUrl==null){
            throw new ValidateException(
                    ManagementRetCode.REQUISITE_PARAMETER_NOT_EXIST.getCode(),
                    ManagementRetCode.REQUISITE_PARAMETER_NOT_EXIST.getMessage());
        }
    }
}
